from presenter import basepresenter

class DiscussionPresenter(basepresenter.BasePresenter):

    def respondToGet(self):
        #get the discussions for the type
        if (self.request.get('type')):
            type = self.request.get('type')
            self.template_values['type'] = type
        else:
            type = '*'
        discussions = self.discussiontask.getDiscussionByType(type)
        self.template_values['discussions'] = discussions

        # set up the page title
        page_title = self.sitetitle + ' - Discussions By Type - ' + type
        self.template_values['page_title'] = page_title

        #get the view to draw the page
        self.view.showGetResponse(self.template_values)